// 开发模式

const { merge } = require("webpack-merge");

const commonConfig = require("./webpack.common");

const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = merge(commonConfig, {
  mode: "development",

  devtool: "cheap-module-source-map",

  module: {
    rules: [
      {
        test: /\.less$/,

        use: ["style-loader", "css-loader", "less-loader"],
      },

      {
        test: /\.css$/,

        use: ["style-loader", "css-loader"],
      },
    ],
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: "./public/index.html",

      title: "jack webapck",
    }),
  ],
});
